<script setup>

import Header from "@/components/header/Header.vue";
import {useRoute} from "vue-router";
import {requestCourseDetail} from "@/api/study/studyApi";

import Editor from "@/components/editor/Editor.vue";

const route = useRoute()

/**
 * 详情
 * @type {null}
 */
const detail = ref({})
const getDetail = () => {
  requestCourseDetail(route.params.id).then(res => {
    detail.value = res.data
  })
}
onMounted(() => {
  getDetail()
})
</script>

<template>
  <Header :page="true"></Header>
  <n-card class="card">
    <h1>{{ detail.title }}</h1>
    <p>科目：
      <n-tag type="success">
        {{ detail.typeName }}
      </n-tag>
    </p>
    <p style="">创建时间：{{ detail.createTime }}</p>

    <Editor
        :initHtml="detail.content"
        :toolbar-visible="false"
        placeholder="请输入"
        :editor-height="'auto'"
        read-only
    />

  </n-card>


</template>

<style scoped lang="less">

</style>